package com.itbaima.csmall.business.service.impl;

import com.itbaima.csmall.business.service.BusinessService;
import com.itbaima.csmall.commons.pojo.order.dto.OrderAddDTO;
import com.itbaima.csmall.order.service.OrderService;
import io.seata.spring.annotation.GlobalTransactional;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

/**
 * <p>Business业务实现类</p>
 *
 * @author Chen
 * @since 2023/2/17 15:49:49
 */
@Slf4j
@Service
public class BusinessServiceImpl implements BusinessService {

    @DubboReference
    private OrderService dubboOrderService;

    @GlobalTransactional
    @Override
    public void buy(OrderAddDTO orderAddDTO) {
        dubboOrderService.orderAdd(orderAddDTO);
        log.info("新增的订单信息为：{}", orderAddDTO);
    }

}
